package main

import (
	"afupanel/components/downloader"
	"afupanel/components/nginx"
	"strings"
)

func main() {
	n := nginx.Nginx{}
	n.GetCurrentStableVersion()
	if n.DownLoadUrl != "" {
		d := downloader.Downloader{
			TargetUrls: []string{n.DownLoadUrl},
			SavingDir:  "D:/",
		}
		d.Start()
	}

}

func GetFileNameWithoutSuffixAndSuffix(filename string) (filenameWithoutSuffix, suffix string) {
	pointIndex := strings.LastIndex(filename, ".")
	if pointIndex != -1 {
		filenameWithoutSuffix = filename[:pointIndex]
		suffix = filename[pointIndex+1:]
	}
	return
}
